What is the best way to handle Saving/Loading an Array of Objects?

您所在的位置:网站首页 procedural objects What is the best way to handle Saving/Loading an Array of Objects?

What is the best way to handle Saving/Loading an Array of Objects?

2024-04-15 02:01| 来源: 网络整理| 查看: 265

Hey Rama,

I’ve been following your Custom Save to Binary Files post on the wiki the past couple days: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

I’m having trouble figuring out how to dynamically save a whole set of objects at runtime based on the ‘SaveGame’ bool that’s a UPROPERTY specifier (or found within a blueprint variable). As it looks right now, it seems like your method needs to explicitly state what kinds of variables will be loaded into the function (unless I’m missing something).

I’ve implemented your approach into a base class inheriting from Actor, so that I can drag it into the scene in order for my UI blueprints to call it. I’ve created Save, Load and SaveLoad functions just like the ones you provided, as well as an additional function that gets called from blueprint (since it didn’t like accepting a SaveBuffer as an input for a UFUNCTION). Currently I’d like to just grab the player controller’s location to save and load it. I can do this in a more convoluted way by passing in the actor through blueprints, grabbing it’s world location in code and storing that vector into the save and load functions. Doing this for every individual variable is highly unperformative, as you could imagine.

How can I pass variables into these functions with explicitly stating all of their types? Is there a way to store all UPROPERTIES under the ‘SaveGame’ specifier into some sort of array that’s passed into this class?

Currently I’m looking into this solution:

Epic Developer Community Forums – 11 May 14 How do I use the SaveGame flag?

Preamble I already know how to save and load variables explicitly handled by a subclass of SaveGameObject as demonstrated in the TappyChicken examples. So, no problems there. This question is about saving variables stored in multiple...

Reading time: 3 mins 🕑 Likes: 6 ❤

The issue is that I don’t understand how to combine your binary method with these other methods of using LoadSaveFromSlot, etc. I’d love to continue using binary conversion because it seems like a much cleaner way to store and load variables.

I apologize if this reply doesn’t really have to do with the original post, but these forums contain no way to private message users from what I can tell



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3